<tagLib name="strends" />

<include file="Public:header" />
<script type="text/javascript" src="__TMPL__Static/Js/dataList.js"></script>
<div class="handle-btns">
	<strends:imageBtn id="addAdmin" name="addAdmin" value="{%ADD}" click="addData()" />
	<strends:imageBtn id="editAdmin" name="editAdmin" value="{%EDIT}" click="editData(this,'checkList','id')" />
	<strends:imageBtn id="removeAdmin" name="removeAdmin" value="{%REMOVE}" click="removeUser(this,'checkList')" />
</div>
<strends:list id="checkList" pk='id' style="list" name="admin" checkbox="true" action="true" datasource="list" 
show="id:{%ID}|80,content:{%CONTENT}|~left,create_time|toDate:{%CREATE_TIME}|140,type|showtype:{%TYPE}|100,status|getStatusImg:{%STATUS}|60:toggleStatus|id" 
actionlist="editData:{%EDIT}:id,removeUser:{%REMOVE}:id" action_width="100" />
<div class="pager">{$page}</div>
<script type="text/javascript">
function removeUser(obj,id,pk)
{
	var ids =  new Array();
	
	if(isNaN(id))
	{
		$("#" + id + " input:checked[name='key']").each(function(){
			ids.push(this.value);
		});
	}
	else
	{
		ids.push(id);
		var parent = $(obj).parent().parent();
		id = parent.parent().parent().attr('id');
	}
	
	ids = ids.join(',');
	if(ids == '')
		return false;
	
	if(!window.confirm(CONFIRM_DELETE))
		return false;

	var url = APP + '?' + VAR_MODULE + '=' + CURR_MODULE + '&' + VAR_ACTION + '=remove&id='+ids;
	
	var fun = function(){
		location.href = url;
	};
	
	setTimeout(fun,1);
}

</script>
<include file="Public:footer" />